﻿@model Survey.Common.Models.Services.ITranslatorModel

@this.CreateForm()

@* ROW 1 *@

@AddControls(
    new Fieldset("w65p mh50 ", Str.Business.Common.Description)
    {
        new DefinitionList(PercentForLabel.p30)
        {
            new TextOrInput().SetSourceProperty(() => Model.Item.Key),
            new TextOrInput().SetSourceProperty(() => Model.Item.Area),
        }
    },
    new Fieldset("w32p mh50 ", Str.Business.Common.Identification)
    {
        new DefinitionList(PercentForLabel.p50)
        {
            new TextOrInput(true)
                .SetSourceProperty(() => Model.Item.ID),
        }
    })

@* ROW 2 *@
@{
    var dl = new DefinitionList(PercentForLabel.p20);
    foreach (var lang in Project.GetLanguages())
    {
        var phrase = Model.Item.Translations.ContainsKey(lang.LanguageName)
                         ? Model.Item.Translations[lang.LanguageName]
                         : string.Empty;
        dl.AddControls
            (
                new DefinitionListItem()
                    .SetLabel(lang.EnglishName + " (" + lang.NativeName + ")", false)
                    .AddControls
                    (
                        new TextOrInput()
                            .SetText(phrase)
                            .SetInputName(lang.LanguageName)
                            .SetMaxLength(2000)
                    )
            );
    }
}
@AddControls(new Fieldset("w98p mh150", Str.Business.Services.Localization) { dl })

@this.CloseForm()

